﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace proyecto
{
    class filter
    {

        private double min;
        private double max;
        private double left;
        private double right;
        private bool click;
         


        public filter()
        {
        }

        public filter(double low, double high)
        {
            min = low;
            max = high;
            left = min;
            right = high;
        }

        public double getMin(){
            return min;
        }
        public double getMax(){
            return max;
        }
        
        public void setMin(double low){
            min=low;
            left = low;
        }

        public void setMax(double high)
        {
            max = high;
            right = high;
        }

        public void setLeftRight(double min, double max)
        {
            left = min;
            right = max;
        }

        public double getLeft()
        {
            return left;
        }

        public double getRight()
        {
            return right;
        }


        public string values(int n)
        {
            n = 2;
            string aux = min.ToString();
            aux = aux.Replace(',', '.');

            /*for (int i = 0; i < aux.Length; i++)
                if (aux[i] == ',') aux[i] = '.';*/
            double dif = (max - min) / (n - 1);

            double aux2 = min + dif;

            string aux3;

            for (int i = 2; i < n; i++)
            {
                aux3 = aux2.ToString();
                aux3 = aux3.Replace(',', '.');
                
                /*for (int i = 0; i < aux3.Length; i++)
                    if (aux3[i] == ',') aux3[i] = '.';*/
                aux=aux+ ",";
                aux = aux + aux3;
                aux2 = aux2 + dif;
            }

            aux = aux + ",";
            aux3=max.ToString();
            aux3 = aux3.Replace(',', '.');
            /*for (int i = 0; i < aux3.Length; i++)
                if (aux3[i] == ',') aux3[i] = '.';*/

            aux = aux + aux3;

            return aux;
        }

        public void changeClick()
        {
            if (click) click = false;
            else click = true;
        }



    }
}
